<?php
declare (strict_types = 1);

namespace app\common\system\model;

use think\Model;
use think\model\concern\SoftDelete;

class AuthNode extends Model
{
    protected $table = "tk_system_auth_node";

    use SoftDelete;
    protected $defaultSoftDelete = 0;

    protected $type = [
        // 'meta' => 'json',
    ];

    public function getMetaAttr($value, $data) {
        // print_r($data);
        return [
            "title" => $data["title"],
            "icon" => $data["icon"],
            "roles" => ["ADMIN"],
            "hidden" => $data["hidden"] == 1,
            "keepAlive" => $data["keep_alive"] == 1,
        ];
    }
}
